﻿Public Class Prestamo : Implements IEquatable(Of Prestamo)

    Public Property Id As String
    Public Property Nombre As String
    Public Property FechaPrestamo As Date
    Public Property FechaDevolucion As Date

    Public Sub New()

    End Sub
    Public Sub New(ByVal id As String, ByVal nombre As String, ByVal fechaPrestamo As Date, ByVal fechaDevolucion As Date)
        Me.Id = id
        Me.Nombre = nombre
        Me.FechaPrestamo = fechaPrestamo
        Me.FechaDevolucion = fechaDevolucion

    End Sub

    Public Overloads Function Equals(other As Prestamo) As Boolean Implements IEquatable(Of Prestamo).Equals
        Return Me.Id = other.Id
    End Function
    Public Function Atrasado(prestamo As Prestamo) As Boolean
        Return prestamo.FechaDevolucion > Today
    End Function
End Class
